package hubol;

import static bogus.core.BogusCore.getTargetFPS;

public class Subimage {
	public final int subimage;
	public final int frameDuration;
	public final float xscale;
	
	/**create a frame with subimage i, duration of 1 second (converted into frames), and no xscale modifier*/
	public Subimage(int i){
		this(i, 1, 9000);
	}
	
	/**create a frame with subimage i and duration in seconds (converted into frames)*/
	public Subimage(int i, double duration){
		this(i, duration, 9000);
	}
	
	/**create a frame with subimage i, duration in seconds (converted into frames), and a float that indicates xscale for this frame and the frames that follow it*/
	public Subimage(int i, double duration, float xsc){
		subimage = i;
		frameDuration = (int)Math.max(duration * getTargetFPS(), 1);
		xscale = xsc;
	}
}
